package com.yh.csx.bsf.flow.provider;

import java.util.Map;

import com.yh.csx.bsf.flow.provider.vo.FlowDetailVO;
import com.yh.csx.bsf.flow.provider.vo.FlowVO;
import com.yh.csx.bsf.flow.provider.enums.FlowStateEnum;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.yh.csx.business.api.entity.CommonResponse;
import com.yh.csx.business.api.entity.PageResponse;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;


@Api(value = "流程操作")
@FeignClient(value = "csx-bsf-flow-provider-rpc")
@RequestMapping(value = "/flow")
public interface IFlowProvider {
	@ApiOperation("发起流程")
	@RequestMapping(value = "/create",method = RequestMethod.POST)
	CommonResponse<Integer> create(@ApiParam("模型名称") String modeName,@ApiParam("自定义标题") String title,  @ApiParam("流程变量") Map<String,String> form, @ApiParam("创建人工号") String userNo);

	@ApiOperation("关闭流程")
	@RequestMapping(value = "/close", method = RequestMethod.POST)
	CommonResponse<String> close(@ApiParam("流程ID") Integer id, @ApiParam("备注说明") String remark, @ApiParam("操作人工号") String userNo) ;

	@ApiOperation("获取我创建的流程列表")
	@RequestMapping(value = "/myCreatedList")
	PageResponse<FlowVO> myCreatedList(@ApiParam("发起人") String creatUserNo, @ApiParam("标题") String title, @ApiParam("流程状态") FlowStateEnum flowState, @ApiParam("创建时间") String createTimeFrom, @ApiParam("截止时间") String createTimeEnd);

	@ApiOperation("流程详情")
	@RequestMapping(value = "/detail")
	CommonResponse<FlowDetailVO> detail(@ApiParam("流程ID") Integer id);
}
